/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package conexao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Weverson e Edlucia
 */
public class Conexao {

    private static Connection conexao = null;

    public static Connection getConexao() {

        if (conexao != null) {
            return conexao;
        } else {
            try {
                // Comando do MYSQL
                // O drive do banco deve ser anexado as bibliotecas do projeto
                String driver = "oracle.jdbc.driver.OracleDriver";
                String url = "jdbc:oracle:thin:@localhost:1521:XE";
                String user = "projetointegrador";
                String password = "123456";

                Class.forName(driver);
                conexao = DriverManager.getConnection(url, user, password);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return conexao;
        }
    }

}
